class Solution(object):
    def duplicateInArray(self, nums):
        """
        :type nums: List[int]
        :rtype int
        """
        for i in range(len(nums)-1):
            for j in range(i+1, len(nums)):
                if nums[j] == nums[i]:
                    return nums[i]